<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/PartFin/partFinStep" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="partFinStep" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="partName1" value="${params.partName1}" />
            <g:hiddenField name="stepName1" value="${params.stepName1}" />
            <label >批次号%：</label>&nbsp;
            <input type="text" name="lotId" value="${lotId}"/>
            <label >加工人%：</label>&nbsp;
            <input type="text" name="jiagongBy" value="${jiagongBy}"/>
            <label >时间段：</label>&nbsp;
            <input type="text" name="startTime" value="${startTime}" data-pattern="yyyy-MM-dd HH:mm:ss"  data-toggle="datepicker" placeholder="FROM">
            <input type="text" name="endTime" value="${endTime}" data-pattern="yyyy-MM-dd HH:mm:ss" data-toggle="datepicker" placeholder="TO">&nbsp;&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/StageWip/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">
    <g:if test="${partFinStep.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${partFinStep.size()>0}">
                <g:each in="${partFinStep}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='CURRENT_STEP_TIME'&&headInstance!='RN'}">
                                <td name="PARTFINTIME${i}">${dataInstance["${headInstance}"]}</td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/pagination" />
<script>
    $(function(){
        for(var i=0;i<${partFinStep.size()};i++){
            var partFinTime="PARTFINTIME"+i;
            var partFinTimeJudge=parseFloat($("td[name='"+partFinTime+"']").text())

            if(partFinTimeJudge>=1&&partFinTimeJudge<3){
                $("td[name='"+partFinTime+"']").css("background-color","#FFFF6F")
                $("td[name='"+partFinTime+"']").nextAll().css("background-color","#FFFF6F")
                $("td[name='"+partFinTime+"']").prevAll().css("background-color","#FFFF6F")

            }else if(partFinTimeJudge>=3&&partFinTimeJudge<7){
                $("td[name='"+partFinTime+"']").css("background-color","#FF9797")
                $("td[name='"+partFinTime+"']").nextAll().css("background-color","#FF9797")
                $("td[name='"+partFinTime+"']").prevAll().css("background-color","#FF9797")
            }else if(partFinTimeJudge>=7){
                $("td[name='"+partFinTime+"']").css("background-color","#FF5151")
                $("td[name='"+partFinTime+"']").nextAll().css("background-color","#FF5151")
                $("td[name='"+partFinTime+"']").prevAll().css("background-color","#FF5151")
            }
        }
    })
</script>

